package org.jingouzhui.domain.strategy.model.entity;

import lombok.*;
import org.jingouzhui.domain.strategy.model.valboj.RuleLogicCheckTypeVO;

/**
 * @description: 过滤完毕后返回的规则动作实体  不同的规则实体会影响到下边的流程变化，比如黑名单的话就被接管那么直接返回
 * 权重的话就去取对应的awardId范围，etc
 * @author: jingouzhui
 * @date: 2025/4/27 0:44
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {

    /**
     * 规则类型  告诉过滤的是哪种类型 eg: rule_weight  rule_black_list
     */
    private String ruleModel;

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();

    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();

    private  T data;

    static  public  class RaffleEntity{

    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    static public class RaffleBeforeEntity extends RaffleEntity{
        /**
         * 策略Id
         */
        private Long strategyId;
        /**
         * 奖品Id【规则类型为策略的话，则不需要奖品Id】
         */
        private Integer awardId;
        /**
         * 权重值key
         */
        private String ruleWeightValueKey;
    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @NoArgsConstructor
    @AllArgsConstructor
    @Builder
    static public class RaffleCenterEntity extends RaffleEntity{
        /**
         * 策略Id
         */
        private Long strategyId;
        /**
         * 奖品Id【规则类型为策略的话，则不需要奖品Id】
         */
        private Integer awardId;
        /**
         * 权重值key
         */
        private String ruleWeightValueKey;
    }

    static public class RaffleAfterEntity extends RaffleEntity{

    }

}
